package com.lhy.dao;

import com.lhy.domain.Department;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author 汪
 */
@Repository
public interface DepartmentDao {
    /**
     * 查找user
     * @param userId
     * @return
     */
    String selectOneByUserId(Integer userId);
    /**
     * 查询所有
     * @return
     */
    List<Department> showAllDepartment();

    /**
     * 精确查询
     * @param department
     * @return
     */
    List<Department> findSomeDepartment(Department department);

    /**
     * 插入数据
     * @param department
     * @return
     */
    int addDepartment(Department department);

    /**
     * 删除记录
     * @param departId
     * @return
     */
    int deleteDepartment(Integer departId);

    /**
     * 修改信息
     * @param departId
     * @param name
     * @param old_departid
     * @return
     */
    int modifyDepartment(@Param("departId") Integer departId,@Param("name") String name,@Param("old_departid") Integer old_departid);

    /**
     * 查询
     * @param departId
     * @return
     */
    Department selectOneById(Integer departId);

    /**
     * 查询
     * @param departName
     * @return
     */
    Department selectOneByName(String departName);
}
